from datetime import timedelta
import logging
from redis import StrictRedis
class Config(object):
    DEBUG = True
    SECRET_KEY = 'SDSADASDSADSA'
    SQLALCHEMY_DATABASE_URI = 'mysql://root:123@127.0.0.1:3306/information17'
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379

    SESSION_TYPE = 'redis'
    SESSION_USE_SIGNER = True
    SESSION_REDIS = StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    PERMANENT_SESSION_LIFETIME = timedelta(days=2)
    LEVEL_NAME = logging.DEBUG

class developmentConfig(Config):
    pass


class ProductConfig(Config):
    DEBUG = False
    LEVEL_NAME = logging.ERROR


class TestConfig(Config):
    DEBUG = True


config_dict = {
    'develope': developmentConfig,
    'product': ProductConfig,
    'test': TestConfig
}